/**
 * Created by Administrator on 2016/4/28.
 */

(function () {
    var app = angular.module('route', ['ngRoute']);

    /**
     * 添加一个controller，提供导航功能
     */
    app.controller('sql', function () {
        this.switch = function (sql_type) {
            location.assign(location.href + sql_type);
        }
    });

    /**
     * 配置angular的route
     */
    app.config(function ($routeProvider) {
        $routeProvider.when('/delete', {
            templateUrl: 'route_delete.html'
        }).when('/insert', {
            templateUrl: 'route_insert.html'
        }).when('/', {
            templateUrl: 'route_insert.html'
        })
        .otherwise({ redirectTo: '/'});
    });
})();
